﻿using System.Web.Http.Dependencies;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Spotted.WebApi.Controllers;
using Spotted.WebApi.Core;

namespace Spotted.WebApi.Tests
{
    [TestClass]
    public class NinjectDependencyResolverTests : TestBase
    {
        private IDependencyResolver _dependencyResolver;

        [TestInitialize]
        public void Init()
        {
            _dependencyResolver = new NinjectDependencyResolver(GetKernel());
        }

        [TestMethod]
        public void test_that_controller_name_type_returns_proper_controller()
        {
            var controller = _dependencyResolver.GetService(typeof (SpotController));

            Assert.AreNotEqual(null, controller);
            Assert.AreEqual(typeof(SpotController), controller.GetType());
        }
    }
}
